
<form id="form" action="{url('mchid/rebuild')}">
    <input type="hidden" name="id" value="{$info.id}" />
    <input id="id_card_copy" type="hidden" name="id_card_copy" value="{$info.id_card_copy}" />
    <input id="id_card_national" type="hidden" name="id_card_national" value="{$info.id_card_national}" />
    <input id="store_entrance_pic" type="hidden" name="store_entrance_pic" value="{$info.store_entrance_pic}" />
    <input id="indoor_pic" type="hidden" name="indoor_pic" value="{$info.indoor_pic}" />
    <div class="titlebar"><i class="iconfont icon-list_icon"></i>小微商户信息 <span class="red fn-f12">门店门口照片/店内环境如没有请百度和去街上拍摄一个(照片上名字和门店名称行业保存一致)</span></div>
    <table class="formtable">
        <tr>
            <th>商户简称:</th>
            <td><input datatype="*" class="input" type="text" name="merchant_shortname" value="{$info.merchant_shortname}" /> <span class="gray">云收银台显示</span></td>
        </tr>
        <tr>
            <th>门店名称:</th>
            <td><input datatype="*" class="input w300" type="text" name="store_name" value="{$info.store_name}" /></td>
        </tr>
        <tr>
            <th>详细地址:</th>
            <td><input datatype="*" class="input w400" type="text" name="store_street" value="{$info.store_street}" /></td>
        </tr>
        <tr>
            <th>手机号:</th>
            <td>
                <input datatype="m" class="input w120" type="text" name="contact_phone" value="{$info.contact_phone}" />
                <span class="gray">1.接收云收银台电话认证 2.接收微信官方电话验证</span>
            </td>
        </tr>
        <tr>
            <th>服务描述:</th>
            <td>
                <select datatype="*" class="select w400" name="product_desc">
                    <option value=""></option>
                    <option value="餐饮" {if $info.product_desc=='餐饮'}selected{/if}>餐饮</option>
                    <option value="线下零售" {if $info.product_desc=='线下零售'}selected{/if}>线下零售</option>
                    <option value="居民生活服务" {if $info.product_desc=='居民生活服务'}selected{/if}>居民生活服务</option>
                    <option value="休闲娱乐" {if $info.product_desc=='休闲娱乐'}selected{/if}>休闲娱乐</option>
                    <option value="交通出行" {if $info.product_desc=='交通出行'}selected{/if}>交通出行</option>
                    <option value="其他" {if $info.product_desc=='其他'}selected{/if}>其他</option>
                </select>   
            </td>
        </tr>
        <tr>
            <th>门口与店内照片</th>
            <td id="imgbox">
                <div class="box-view select_img w250 h170" data="store_entrance_pic"><img src="{$info.store_entrance_pic}"></div>
                <div class="box-view select_img w250 h170" data="indoor_pic"><img src="{$info.indoor_pic}"></div>
            </td>
        </tr>
    </table>
    <div class="titlebar"><i class="iconfont icon-list_icon"></i> 身份证 <span class="red fn-f12">必须和开户行信息一致</span></div>
    <table class="formtable">
        <tr>
            <th>身份证姓名:</th>
            <td><input datatype="*" class="input w300" type="text" name="id_card_name" value="{$info.id_card_name}" /></td>
        </tr>
        <tr>
            <th>身份证号码:</th>
            <td><input datatype="idcard" class="input w300" type="text" name="id_card_number" value="{$info.id_card_number}" /></td>
        </tr>
        <tr><th>身份证有效期:</th><td>
            <input readonly placeholder="开始时间" class="input w160 ui-date" datatype="date" type="text" name="start_time" value="{$info.start_time}"/>
            <span class="blue">至</span> 
            <input placeholder="结束时间" class="input w160 ui-date" type="text" name="end_time" value="{$info.end_time}"/> <span class="gray">结束日期为空是：<span class="red">长期</span></span>
        </td></tr>
        <tr>
            <th>认证身份证</th>
            <td id="imgbox">
                <div class="box-view select_img w250 h170" data="id_card_copy"><img src="{$info.id_card_copy}"></div>
                <div class="box-view select_img w250 h170" data="id_card_national"><img src="{$info.id_card_national}"></div>
            </td>
        </tr>
    </table>
    <div class="titlebar"><i class="iconfont icon-list_icon"></i>开户行信息 <span class="red fn-f12">必须和身份证信息一致</span></div>
    <table class="formtable">
        <tr>
            <th>开户银行:</th>
            <td>
                <select class="select w400" name="account_bank">
                    <option value=""></option>
                    <option value="工商银行" {if $info.account_bank=='工商银行' }selected{/if}>工商银行</option>
                    <option value="交通银行" {if $info.account_bank=='交通银行' }selected{/if}>交通银行</option>
                    <option value="招商银行" {if $info.account_bank=='招商银行' }selected{/if}>招商银行</option>
                    <option value="民生银行" {if $info.account_bank=='民生银行' }selected{/if}>民生银行</option>
                    <option value="中信银行" {if $info.account_bank=='中信银行' }selected{/if}>中信银行</option>
                    <option value="浦发银行" {if $info.account_bank=='浦发银行' }selected{/if}>浦发银行</option>
                    <option value="兴业银行" {if $info.account_bank=='兴业银行' }selected{/if}>兴业银行</option>
                    <option value="光大银行" {if $info.account_bank=='光大银行' }selected{/if}>光大银行</option>
                    <option value="广发银行" {if $info.account_bank=='广发银行' }selected{/if}>广发银行</option>
                    <option value="平安银行" {if $info.account_bank=='平安银行' }selected{/if}>平安银行</option>
                    <option value="北京银行" {if $info.account_bank=='北京银行' }selected{/if}>北京银行</option>
                    <option value="华夏银行" {if $info.account_bank=='华夏银行' }selected{/if}>华夏银行</option>
                    <option value="农业银行" {if $info.account_bank=='农业银行' }selected{/if}>农业银行</option>
                    <option value="建设银行" {if $info.account_bank=='建设银行' }selected{/if}>建设银行</option>
                    <option value="中国银行" {if $info.account_bank=='中国银行' }selected{/if}>中国银行</option>
                    <option value="邮政储蓄银行" {if $info.account_bank=='邮政储蓄银行' }selected{/if}>邮政储蓄银行</option>
                </select>
            </td></tr>
        <tr><th>收款银行卡号:</th><td><input id="account_number" datatype="*" class="input w400" type="text" name="account_number" value="{$info.account_number}" /></td></tr>
        <tr>
            <th>开户所在城市:</th>
            <td>
                <div id="distpicker">
                    <select class="select province"></select>
                    <select class="select city"></select>
                    <select class="select district"></select>
                </div>
            </td>
        </tr>
        <tr>
            <th>开户地城市码:</th>
            <td>
                <input id="bank_address_code" datatype="n6-16" class="input w80" type="text" name="bank_address_code" value="{$info.bank_address_code}" />
                <button type="button" class="button get_address_code">读取城市码</button>
                <span class="gray fn-f12">非城市邮编或区号,<a href="https://pay.weixin.qq.com/wiki/doc/api/download/wx_cityno.zip" class="red">点击详细查询</a></span><br />
            </td>
        </tr>
        <tr><th></th><td><input type="submit" value="核对信息无误,确认再次提交" class="button submit button-blue" /></td></tr>
    </table>
</form>
<script type="text/javascript">
Do('base','layer','form','city','date', function () {
    $('#form').isForm();
    $("#distpicker").distpicker({ province: '---- 所在省 ----', city: '---- 所在市 ----', district: '---- 所在区 ----' });
    $(".get_address_code").click(function () {
        var province = $(".province").val(), city = $(".city").val(), district = $(".district").val();
        $.getJSON("{:url('mchid/bankAddressCode')}", { 'province': province, 'city': city, 'district': district }, function (rel) {
            if (rel.code == '200') {
                $("#bank_address_code").val(rel.data)
            } else {
                parent.layer.msg(rel.msg, { icon: 5, shade: 0.5 })
            }
        });
    })
    $(".select_img").click(function () {
        $(this).popup({'url':'{:url("system/passport.common/upload")}'});
        autoPlay();
    });
})
function autoPlay() {
    setInterval(function () {
        console.log('1');
        var card_copy = $("#id_card_copy").val(), card_national = $("#id_card_national").val(), store_entrance_pic = $("#store_entrance_pic").val(), indoor_pic = $("#indoor_pic").val();
        "" != card_copy && $("div[data='id_card_copy']").html('<img src="' + card_copy + '">');
        "" != card_national && $("div[data='id_card_national']").html('<img src="' + card_national + '">');
        "" != store_entrance_pic && $("div[data='store_entrance_pic']").html('<img src="' + store_entrance_pic + '">');
        "" != indoor_pic && $("div[data='indoor_pic']").html('<img src="' + indoor_pic + '">');
    }, 3000)
}
</script>